<?php
class TextinfoModel extends CommonModel {
	public function _list_($map = '' ,$page = 1,$limit = 16, $orderby = ' id desc'){
        $list['count'] = $this->where($map)->count('id');
        $list['page'] = $page;
        $list['map'] = $map;
        $list['limit'] = $limit;
        $pagecount = ceil($list['count'] / $list['limit']);
        if ($pagecount < 1) $pagecount =1;
        $list['pagecount'] = $pagecount;
        $vlist   =   $this->where($map)->page($page,$limit)->order(" $orderby ")->select();
        $volist = array();
        foreach ($vlist as $key) {
            $key['help_text'] = $this->getHelp($key['ishelp']);
        	// $key['help_text'] = '1212';
        	$key['welcome_text'] = $this->getWelcome($key['iswelcome']);
        	$volist[] = $key;
        }
        $list['volist']   =   $volist;
        return $list;
    }

    public function getWelcome($iswelcome = 0)
    {
    	if ($iswelcome == 1) {
    		return "关注回复";
    	}
    	return "";
    }

    public function getHelp($ishelp = 0)
    {
    	if ($ishelp == 1) {
    		return "自动回复";
    	}
    	return "";
    }

}